import { ResultStatus } from './result';

export class Result<T = any> {
  status: ResultStatus;
  code: number;
  message: string;
  data?: T;

  constructor(
    status: ResultStatus,
    code: number,
    message: string,
    data?: T,
  ) {
    this.status = status;
    this.code = code;
    this.message = message;
    if (data !== undefined) this.data = data;
  }
}
